package com.qf.springboottest.ex;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 自定义异常
 * */
@Data
@NoArgsConstructor
public class UserException extends Exception {
    private Integer code; //异常编号,例如：001代表用户名重复
    private String msg; //异常的自定义消息

    public UserException(Integer code, String msg){

        super(msg); //调用父类的单参构造函数
        this.code = code;
        this.msg = msg;
    }
}
